#ifndef INICONFIG_H
#define INICONFIG_H

#include <QSettings>
#include <QObject>
#include <QMutex>
#include <QReadWriteLock>
#include "baseconfig.h"

class IniConfig : public BaseConfig
{
    Q_OBJECT
public:
    IniConfig(const QString &fileName, QObject *parent = nullptr);
    ~IniConfig() override;

    bool init();

    void setFileName(const QString &filename);
    const QString &getFileName() const;

    virtual bool get(const QString &key, QVariant &value) override;
    virtual bool set(const QString &key, const QVariant &value) override;

private:
    QSettings       *m_setting = nullptr;
    QString         m_fileName;
};



#endif
